<?php
//src/Pyaf/GymBundle/Entity/Alumno.php
namespace Pyaf\GymBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * Alumno
 *
 * @ORM\Table()
 * @ORM\Entity(repositoryClass="Pyaf\GymBundle\Repository\AlumnoRepository")
 */
class Alumno {
    /**
     * @var integer
     *
     * @ORM\Column(name="id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    private $id;

    /**
     * @var string
     *
     * @ORM\Column(name="promocion", type="string", length=255)
     */
    private $promocion;

    /**
     * @var integer
     *
     * @ORM\Column(name="cuota", type="integer")
     * 
     */
    private $cuota;
    
    /**
     * @var Persona 
     * @ORM\OneToOne(targetEntity="Persona", cascade={"persist", "remove"})
     * @ORM\JoinColumn (name="persona_id", referencedColumnName="id", nullable=true)
     */
    private $persona;
    
    /**
     * @ORM\ManyToMany(targetEntity="Clase", mappedBy="alumnos")
     */
    protected $clases;
    
    /**
     * @ORM\OneToMany(targetEntity="AvisoFalta", mappedBy="alumno")
     */
    protected $avisos;
    
    /**
     * @ORM\OneToMany(targetEntity="AvisoFalta", mappedBy="alumnoRecupera")
     */
    protected $avisosRecuperacion;
    
    /**
     * @ORM\OneToMany(targetEntity="Asistencia", mappedBy="alumno")
     */
    protected $asistencias;
    
    /**
     * @ORM\OneToMany(targetEntity="Cuota", mappedBy="alumno")
     */
    protected $cuotas;
    

    /**
     * Get id
     *
     * @return integer 
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set promocion
     *
     * @param string $promocion
     * @return Alumno
     */
    public function setPromocion($promocion)
    {
        $this->promocion = $promocion;
    
        return $this;
    }

    /**
     * Get promocion
     *
     * @return string 
     */
    public function getPromocion()
    {
        return $this->promocion;
    }

    /**
     * Set cuota
     *
     * @param integer $cuota
     * @return Alumno
     */
    public function setCuota($cuota)
    {
        $this->cuota = $cuota;
    
        return $this;
    }

    /**
     * Get cuota
     *
     * @return integer 
     */
    public function getCuota()
    {
        return $this->cuota;
    }
    
    /**
     * Constructor
     */
    public function __construct()
    {
        $this->clases = new \Doctrine\Common\Collections\ArrayCollection();
    }
    
     public function __toString()
    {
        return $this->getNombreCompleto();
    }

    public function getNombreCompleto()
    {
        return $this->persona->getNombre().' '.$this->persona->getApellido();
    }
    
    /**
     * Set persona
     *
     * @param \Pyaf\GymBundle\Entity\Persona $persona
     * @return Alumno
     */
    public function setPersona(\Pyaf\GymBundle\Entity\Persona $persona = null)
    {
        $this->persona = $persona;
    
        return $this;
    }

    /**
     * Get persona
     *
     * @return \Pyaf\GymBundle\Entity\Persona 
     */
    public function getPersona()
    {
        return $this->persona;
    }

    /**
     * Add clases
     *
     * @param \Pyaf\GymBundle\Entity\Clase $clases
     * @return Alumno
     */
    public function addClase(\Pyaf\GymBundle\Entity\Clase $clases)
    {
        $this->clases[] = $clases;
    
        return $this;
    }

    /**
     * Remove clases
     *
     * @param \Pyaf\GymBundle\Entity\Clase $clases
     */
    public function removeClase(\Pyaf\GymBundle\Entity\Clase $clases)
    {
        $this->clases->removeElement($clases);
    }

    /**
     * Get clases
     *
     * @return \Doctrine\Common\Collections\Collection 
     */
    public function getClases()
    {
        return $this->clases;
    }

    /**
     * Add avisos
     *
     * @param \Pyaf\GymBundle\Entity\AvisoFalta $avisos
     * @return Alumno
     */
    public function addAviso(\Pyaf\GymBundle\Entity\AvisoFalta $avisos)
    {
        $this->avisos[] = $avisos;
    
        return $this;
    }

    /**
     * Remove avisos
     *
     * @param \Pyaf\GymBundle\Entity\AvisoFalta $avisos
     */
    public function removeAviso(\Pyaf\GymBundle\Entity\AvisoFalta $avisos)
    {
        $this->avisos->removeElement($avisos);
    }

    /**
     * Get avisos
     *
     * @return \Doctrine\Common\Collections\Collection 
     */
    public function getAvisos()
    {
        return $this->avisos;
    }

    /**
     * Add avisosRecuperacion
     *
     * @param \Pyaf\GymBundle\Entity\AvisoFalta $avisosRecuperacion
     * @return Alumno
     */
    public function addAvisosRecuperacion(\Pyaf\GymBundle\Entity\AvisoFalta $avisosRecuperacion)
    {
        $this->avisosRecuperacion[] = $avisosRecuperacion;
    
        return $this;
    }

    /**
     * Remove avisosRecuperacion
     *
     * @param \Pyaf\GymBundle\Entity\AvisoFalta $avisosRecuperacion
     */
    public function removeAvisosRecuperacion(\Pyaf\GymBundle\Entity\AvisoFalta $avisosRecuperacion)
    {
        $this->avisosRecuperacion->removeElement($avisosRecuperacion);
    }

    /**
     * Get avisosRecuperacion
     *
     * @return \Doctrine\Common\Collections\Collection 
     */
    public function getAvisosRecuperacion()
    {
        return $this->avisosRecuperacion;
    }

    /**
     * Add asistencias
     *
     * @param \Pyaf\GymBundle\Entity\Asistencia $asistencias
     * @return Alumno
     */
    public function addAsistencia(\Pyaf\GymBundle\Entity\Asistencia $asistencias)
    {
        $this->asistencias[] = $asistencias;
    
        return $this;
    }

    /**
     * Remove asistencias
     *
     * @param \Pyaf\GymBundle\Entity\Asistencia $asistencias
     */
    public function removeAsistencia(\Pyaf\GymBundle\Entity\Asistencia $asistencias)
    {
        $this->asistencias->removeElement($asistencias);
    }

    /**
     * Get asistencias
     *
     * @return \Doctrine\Common\Collections\Collection 
     */
    public function getAsistencias()
    {
        return $this->asistencias;
    }

    /**
     * Add cuotas
     *
     * @param \Pyaf\GymBundle\Entity\Cuota $cuotas
     * @return Alumno
     */
    public function addCuota(\Pyaf\GymBundle\Entity\Cuota $cuotas)
    {
        $this->cuotas[] = $cuotas;
    
        return $this;
    }

    /**
     * Remove cuotas
     *
     * @param \Pyaf\GymBundle\Entity\Cuota $cuotas
     */
    public function removeCuota(\Pyaf\GymBundle\Entity\Cuota $cuotas)
    {
        $this->cuotas->removeElement($cuotas);
    }

    /**
     * Get cuotas
     *
     * @return \Doctrine\Common\Collections\Collection 
     */
    public function getCuotas()
    {
        return $this->cuotas;
    }
}